"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.狙炮 = void 0;
const Big_1 = require("../core/Big");
const Point_1 = require("../core/Point");
const GameUtils_1 = __importDefault(require("../GameUtils"));
class 狙炮 extends Big_1.Big {
    constructor() {
        super(...arguments);
        this.point_aim = null;
    }
    turnStart() {
        if (this.point_aim != null) {
            this.shellLanding(this.point_aim);
            this.point_aim = null;
        }
        this.actionTime = 1;
        this.update();
    }
    terrainAdapt() {
        switch (this.point.terrain) {
            case Point_1.Terrain.SHAN:
            case Point_1.Terrain.SHUI:
                this.die(this.player);
        }
    }
    /** 炮弹落地 */
    shellLanding(endPoint) {
        this.gameMgr.sendBroadcast(GameUtils_1.default.getObj("大炮_bombing", { "start": this.point.id, "end": endPoint.id }));
        setTimeout(() => {
            let big_end = endPoint.big;
            if (big_end != null) {
                big_end.attacked(this.player);
            }
        }, 600);
    }
}
exports.狙炮 = 狙炮;
